// 导入模块 path
const path = require('path')
// 配置webpack的配置文件，需要将配置的对象导出，给webpack使用
module.exports = {
    // 1. 入口 entry，从哪个文件开始打包
    entry: './src/main.js',
    // 2. 出口 outputs，打包到哪里去
    output: {
        // 打包输出目录
        path: path.join(__dirname, 'dist'),
        // 以下目录配置报错
        /**
         * Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
         *  - configuration.output.path: The provided value "./dist/" is not an absolute path!
         *    -> The output directory as **absolute path** (required).
         * error Command failed with exit code 1.
         */
        //path: './dist/',
        // 打包后生成的文件名
        filename: 'bundle.js'
    },
    // 3. 模式 mode，development 未压缩的，production 压缩的
    mode: 'development'
}